The present invention relates to a file conversion apparatus for a machining program for a numerical control system and a computer readable recording medium for storing a program for the computer to execute the file conversion process. More particularly this invention relates to a file conversion apparatus for a machining program including a NURBS interpolation command and a computer readable recording medium for storing a program for the computer to execute the file conversion process.
In a numerical control system, basic commands for designating the machine travel route include a linear interpolation command (G01) and an arcuate interpolation command (G02, G03).
For designating a travel route corresponding to a free curved shape, a curve is approximated with minuscule line segments and a command is issued according to linear interpolation. In such a linear interpolation of minuscule line segments, a string of points on the curve are connected by straight lines for interpolation. Depending on the accuracy of approximating the curve by minuscule line segments, therefore, the machine travel route may lose the smoothness in the boundary between minuscule line segments.
In view of this, the method of generation of a smooth curved interpolation trace by passing through a string of points formed by spline interpolation instead of by linear interpolation has already been employed in some fields.
FIGS. 17(a) and (b) show about a spline interpolation and a command program. In this program, the G code for designating a spline are described. Then, the coordinates of a series of the passing points are described so that the numerical control system controls the machine travel through a smooth designated route passing through the designated string of points.
In FIGS. 17(a) and (b), the machine travels up to a point P0 by linear interpolation according to a command code G01, and then the spline interpolation mode with a command code G06.1 is entered, followed by designating the coordinate values of the passing points P1, P2, . . . , Pn. In this way, the machine is controlled to travel along a smooth curve passing through the points P1, P2, . . . , Pn.
A technique has also been proposed in which a part of the curve is not approximated by minuscule line segments but directly by an arithmetic definition of the curve. This curve definition is directly read by the numerical control system so that the machine travel route is controlled by the curve interpolation. For the curve definition in this case, the NURBS (Non Uniform Rational B-Spline) having a high freedom of curve expression has been proposed.
FIG. 14 shows a command format according to a program for NURBS interpolation described in Japanese Patent Application Laid-Open Publication No. HEI 4-175905. In this command format, the number of steps of NURBS is designated by address M following the code G70.0, the number of control points of NURBS by address N, the knot vector by address K following the code 70.0, the (X, Y, Z) coordinate of each control point by addresses X, Y, Z following G70.1, and the weight of each control point by address W.
FIG. 15 shows a command format according to the program for NURBS interpolation described the above mentioned publication HEI 8-305430. In this command format, the number of steps of NURBS is designated by address P following code G06.2, the knot vector by address K, the (X, Y, Z) coordinate of control points by addresses X, Y, Z, and the weight of each control point by address R.
In any way, the NURBS curve can be uniquely defined by designating the number of steps and the coordinates and the weight of each control point.
In a NC machine tool having the NURBS interpolation function, the machining program including the NURBS interpolation command described in the format described above is directly read and the distance covered along the NURBS curve is distributively controlled at servo interpolation periods thereby to carry out the NURBS interpolation.
The NC machine tool having the NURBS interpolation function, however, has yet to find wide applications, and such a function, if any, is offered as an expensive option.
Further, the NURBS interpolation command lacks a standard format, and different NC system makers employ different formats.
Therefore, there is disadvantage that only a small proportion of specified machines can actually carry out the machining work using a machining program output in a format including the NURBS interpolation command designed according to NURBS having a high degree of shape design freedom.
Another problem is that the machining program prepared in the NURBS interpolation command format of a given company cannot be used for the machining work on the NC machine tool of another company.
The present invention has been developed in view of the problems described above, and the object thereof is to provide a file conversion apparatus in which a machining program including the NURBS interpolation command described in a given format is converted into a machining program having a code system or a format usable with a NC machine tool not equipped with the NURBS interpolation function but supports the linear interpolation, the spline interpolation or the NURBS interpolation command of a different format, and a computer readable recording medium for storing a program for the computer to execute the file conversion process.
According to the present invention, there is provided a computer-operated file conversion apparatus for converting a source file constituting a machining program for a numerical control system including the NURBS interpolation command into a destination file, comprising a conversion unit for inputting the machining program as the source file, sequentially analyzing the input machining program, and leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into a minuscule line segment interpolation command, wherein the destination file is generated by leaving portions other than the NURBS interpolation command as they are by the conversion unit and converting the NURBS interpolation command into a minuscule line segment interpolation command.
As a result, the NURBS interpolation command of a machining program for a numerical control system including the NURBS interpolation command is converted into a minuscule line segment interpolation command, and an ordinary machining program including no NURBS interpolation command is obtained as a destination file.
Further, according to the present invention, there is provided a computer-operated file conversion apparatus for converting a source file constituting a machining program including the NURBS interpolation command for a numerical control system into a destination file, comprising a conversion unit for inputting the machining program as the source file, sequentially analyzing the input machining program, and leaving portions other than the NURBS interpolation command portion as they are and converting the NURBS interpolation command portion into a spline interpolation command, wherein the destination file is produced by leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into the spline interpolation command by the conversion unit.
As a result, the NURBS interpolation command of a machining program for a numerical control system including the NURBS interpolation command is converted into the spline interpolation command thereby to produce an ordinary machining program not including any NURBS interpolation command as a destination file.
Further, according to the present invention, there is provided a computer-operated file conversion apparatus for a machining program for a numerical control system, comprising a unit for converting the NURBS interpolation command into a spline interpolation command, wherein a string of points is generated by polygonal approximation in such a manner as to secure a chord error from the NURBS curve within a tolerance, a spline curve passing through the point string is generated, the error between the line segment in each section between the passing points and the spline curve is evaluated in order to check whether the error is within a tolerance or not, and if the error exceeds the tolerance then a passing point is added in the corresponding section to reconstruct the point string, and the point string thus reconstructed is used as a passing point string for the spline interpolation command.
Thus, a point string is constructed with the error kept less than the tolerance between the line segment in each section between the passing points and the spline curve, thereby producing a smooth spline curve.
Further, according to the present invention, there is provided a file conversion apparatus for a machining program for a numerical control system, in which when a passing point is added while constructing a string of passing points of a spline curve from the NURBS curve, a spline curve passing a reconstructed point string is generated from the reconstructed point string, the error between the line segment in each section between the passing points and the spline curve is evaluated in order to check whether the error is within a tolerance or not, and when the error exceeds the tolerance then a passing point is added in the particular section thereby to reconstruct the point string, the process being repeated until there are no new passing points to be added.
As a result, a point string is constructed in which the error between each line segment between the passing points and the spline curve is within a tolerance so that a smooth spline curve is obtained over a wide area.
Further, according to the present invention, there is provided a computer-operated file conversion apparatus for converting a source file constituting a machining program for a numerically controlled machine tool including the NURBS interpolation command into a destination file, comprising a conversion unit for inputting the machining program as the source file, sequentially analyzing the input machining program, and leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into a NURBS interpolation command of a differently presented specification, wherein the destination file is generated by leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into a NURBS interpolation command of a differently presented specification.
As a result, the NURBS interpolation command for a machining program for a numerical control system including the NURBS interpolation command is converted into a NURBS interpolation command of a differently presented specification, thereby producing a machining program based on the NURBS interpolation command of a differently presented specification as a destination file.
Further, according to the present invention, there is provided a computer-operated file conversion apparatus for converting a source file constituting a machining program for a numerically controlled machine tool including the NURBS interpolation command into a destination file, comprising a conversion unit for inputting the machining program as the source file, sequentially analyzing the input machining program, and leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into a minuscule line segment interpolation command; a the conversion unit for leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into a spline interpolation command; a the conversion unit for leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into a NURBS interpolation command of a differently presented specification; and a conversion mode setting unit for selectively setting any one of the aforementioned three conversion units, wherein a destination file is generated by leaving portions other than the NURBS interpolation command as they are and converting the NURBS interpolation command into a minuscule line segment command, a spline interpolation command or a NURBS interpolation command of a differently presented specification in accordance with the conversion mode selectively set by the conversion mode setting unit.
As a result, the conversion mode can be selectively set by the conversion mode setting unit, and in accordance with the conversion mode selectively set, the NURBS interpolation command is converted into a minuscule line segment interpolation command or a spline interpolation command, and an ordinary machining program not containing the NURBS interpolation command or the NURBS interpolation command is converted into a NURBS interpolation command of a differently presented specification as a destination file, thus producing a machining program based on the NURBS interpolation command of a differently presented specification as a destination file.
Further, according to the present invention, there is provided a computer-readable recording medium for storing a program for the computer to execute a step of inputting a machining program for a numerical control system including the NURBS interpolation command as a source file; a the step of sequentially analyzing the input machining program; a the step of leaving portions other than the NURBS command portion as they are and converting the NURBS interpolation command into a minuscule line segment interpolation command; and a step of writing into the destination file the data obtained by leaving portions other than the NURBS interpolation command portion as they are and converting the NURBS interpolation command into the minuscule line segment interpolation command.
As a result, the program stored in the recording medium can be executed on a computer, so that the NURBS interpolation command of the machining program for a numerical control system including the NURBS interpolation command is converted into a minuscule line segment interpolation command, thereby producing an ordinary machining program not including the NURBS interpolation command as a destination file.
Further, according to the present invention, there is provided a computer-readable recording medium for storing a program for the computer to execute a step of inputting a machining program for a numerical control system including the NURBS interpolation command as a source file; a step of sequentially analyzing the input machining program; a step of leaving portions other than the NURBS command portion as they are and converting the NURBS interpolation command into a spline interpolation command; and a step of writing into the destination file the data obtained by leaving portions other than the NURBS interpolation command portion as they are and converting the NURBS interpolation command into the spline interpolation command.
As a result, the program stored in the recording medium is executed by the computer, so that the NURBS interpolation command of a machining program for a numerical control system including the NURBS interpolation command is converted into a spline interpolation command, thereby producing an ordinary machining program not including the NURBS interpolation command as a destination file.
Further, according to the present invention, there is provided a computer-readable recording medium for storing a program for the computer to execute a step of converting the NURBS interpolation command into a spline interpolation command, comprising substeps of generating a string of points with the help of polygonal approximation to secure the chord error from the NURBS curve within a tolerance, generating a spline curve passing through the particular point string, and evaluating in order to check whether the error between the line segment in each section of the passing points and the spline curve is within a tolerance or not, and reconstructing a point string by adding a passing point in the corresponding section if the error exceeds the tolerance, and using the reconstructed point string a string of passing points for the spline interpolation command.
As a result, the program stored in the recording medium can be executed on a computer so that a point string having an error not more than a tolerance between the line segment in each section between passing points and the spline curve is constructed thereby to produce a smooth spline curve.
Further, according to the present invention, there is provided a computer-readable recording medium for storing a program for the computer to execute a step of constructing a string of points for a spline curve from the NURBS curve, comprising substeps of, when a passing point is added, regenerating a spline curve passing through the reconstructed point string from the particular point string, evaluating in order to check whether the error between the line segment in each section between the passing points and the tertiary spline curve is within a tolerance or not, and reconstructing the point string by adding a passing point in the corresponding section if the error exceeds the tolerance, the whole process being repeated until there is no new passing point to be added.
As a result, the program stored in the recording medium can be executed on a computer, so that a point string is constructed with the error not more than a tolerance between the line segment in each section between the passing points and the spline curve, thereby producing a smooth spline curve over a wide area.
Further, according to the present invention, there is provided a computer-readable recording medium for storing a program for the computer to execute a step of inputting a machining program for a numerical control system including the NURBS interpolation command as a source file; a step of sequentially analyzing the input machining program; a step of leaving portions other than the NURBS command portion as they are and converting the NURBS interpolation command into a spline interpolation command; a step of leaving portions other than the NURBS interpolation command portion as they are and converting the NURBS interpolation command portion into a NURBS interpolation command of a differently presented specification; and a step of writing into a destination file the data obtained by leaving portions other than the NURBS interpolation portion as they are and converting the NURBS interpolation command into a NURBS interpolation command of a differently presented specification.
As a result, the program stored in the recording medium can be executed on a computer so that the NURBS interpolation command for a machining program for a numerical control system including the NURBS interpolation command is converted into a NURBS interpolation command of a differently presented specification thereby to produce a machining program based on the NURBS interpolation command of a differently presented specification as a destination file.
Further, according to the present invention, there is provided a computer-readable recording medium for storing a program for the computer to execute a step of inputting a machining program for a numerically controlled machine tool including the NURBS interpolation command as a source file; a step of sequentially analyzing the input machining program; a step of leaving portions other than the NURBS command portion as they are and converting the NURBS interpolation command into a minuscule line segment interpolation command; a step of leaving portions other than the NURBS interpolation command portion as they are and converting the NURBS interpolation command portion into a spline interpolation command; a step of leaving portions other than the NURBS interpolation command portion as they are and converting the NURBS interpolation command portion into a NURBS interpolation command of a differently presented specification; a conversion mode setting step of selectively setting any one of the aforementioned three conversion steps, and a step of writing into the destination file the data obtained by leaving portions other than the NURBS interpolation portion as they are and converting the NURBS interpolation command into a minuscule line segment interpolation command, a spline interpolation command or a NURBS interpolation command of a differently presented specification in accordance with the conversion mode selectively set by the conversion mode setting step.
As a result, the program stored in the recording medium can be executed on a computer so that the conversion mode can be selectively set by the conversion mode setting step, and in accordance with the selectively set conversion mode, the NURBS interpolation command portion is converted into a minuscule line segment interpolation command or a spline interpolation command, and an ordinary machining program not including the NURBS interpolation command or the NURBS interpolation command is converted into a NURBS interpolation command of a differently presented specification as a destination file thereby to produce a machining program based on the NURBS interpolation command of a differently presented specification as a destination file.